package com.digdes.calendar.gwt.client.dto;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

public class PlaceDTOImpl implements Serializable {
       private long id;
       private String address;
       private Set<EventDTOImpl> events = new HashSet<EventDTOImpl>(0);

       public PlaceDTOImpl(){

       }

       public PlaceDTOImpl(long id, String address, Set<EventDTOImpl> events){
           this.id = id;
           this.address = address;
           this.events = events;
       }

    public int hashCode() {
        return (int) id;
    }

    public boolean equals(Object o) {
        if(!(o instanceof PlaceDTOImpl)) return false;
        PlaceDTOImpl e = (PlaceDTOImpl) o;
        return e.getAddress().equals(this.address);
    }
       public Long getId() {
           return id;
       }

       public void setId(Long id) {
           this.id = id;
       }

       public String getAddress() {
           return address;
       }

       public void setAddress(String address) {
           this.address = address;
       }

       public Set<EventDTOImpl> getEvents() {
           return this.events;
       }

       public void setEvents(Set<EventDTOImpl> events) {
           this.events = events;
       }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        sb.append("PlaceDTOImpl");
        sb.append("{address='").append(address).append('\'');
        sb.append(", id=").append(id);
        sb.append('}');
        return sb.toString();
    }
}

